package org.csmz.class2333;

import java.util.Scanner;

public class Example01 {
    public static void main(String[] args){
        int a, b, c;
        Scanner myScanner = new Scanner(System.in);
        System.out.println("请输入需要判断是否为水仙花数的数：");
        int count = myScanner.nextInt();
        a = count / 100;
        b = count % 100 / 10;
        c = count % 10;
        if (count >= 100 && count <=1000){
            if (a * a * a + b * b * b + c * c * c == count){
                System.out.println(count + "是水仙花数！");
            }
            else{
                System.out.println(count + "不是水仙花数！");
            }
        }
        else{
            System.out.println(count + "请输入100~1000之间的整数！");
        }
    }
}

